home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-12 | 1.3 KB | 52 lines | [TEXT/CWIE] |
- /*
- CChangeEntryAction.cp
-
- Copyright © 1995 Alastair Rankine.
- All Rights Reserved.
- */
-
- #include "CChangeEntryAction.h"
- #include "CEntryList.h"
- #include "CLookupDocument.h"
- #include "ResourceIDs.h"
- #include <UAEGizmos.h>
-
- CChangeEntryAction::CChangeEntryAction(CLookupDocument & inLookupDocument, UInt16 inRow,
- const CEntry & inNewData)
- : LAEAction(STRx_RedoEdit, str_RedoChange)
- {
- LAEStream redo(kAECoreSuite, kAESetData);
- LAEStream undo(kAECoreSuite, kAESetData);
-
- // keyDirectObject - the record to change.
- const CEntry & changeEntry = inLookupDocument.GetEntryAt(inRow);
- redo.WriteKey(keyDirectObject);
- redo.WriteSpecifier(&changeEntry);
- undo.WriteKey(keyDirectObject);
- undo.WriteSpecifier(&changeEntry);
-
- // keyAEData - a record with the change info:
- StAEDescriptor newProps;
- inNewData.GetDifferentAEProperties(changeEntry, newProps.mDesc);
- redo.WriteKeyDesc(keyAEData, newProps.mDesc);
-
- StAEDescriptor oldProps;
- changeEntry.GetDifferentAEProperties(inNewData, oldProps.mDesc);
- undo.WriteKeyDesc(keyAEData, oldProps.mDesc);
-
- // Close the stream, and assign the AE to the Redo event.
- StAEDescriptor redoEvent;
- redo.Close(&redoEvent.mDesc);
- SetRedoAE(redoEvent.mDesc);
-
- // Close the stream, and assign the AE to the Redo event.
- StAEDescriptor undoEvent;
- redo.Close(&undoEvent.mDesc);
- SetUndoAE(undoEvent.mDesc);
- }
-
-
-
-
-
-